package com.example.a79273.nvshenyichu.fragment;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ScrollView;
import android.widget.TextView;

import com.example.a79273.nvshenyichu.R;

/**
 * Created by 79273 on 2016/8/28.
 */
public class DanPin extends Fragment{
    private View view;
    private ScrollView scrollView;
    private View itemView;
    private ImageView imageView;
    private TextView textView;
    private LinearLayout ll_single_item;
    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup
            container, @Nullable Bundle savedInstanceState) {
        view=inflater.inflate(R.layout.fragment_single,null);
       initView();
        initData();
        setData();
        setListener();
        return view;
    }

    private void setListener() {
        itemView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

            }
        });
    }

    private void setData() {
    }

    private void initData() {
        for (int i = 0; i <9 ; i++) {
            itemView=View.inflate(getActivity(),R.layout.item_single,null);
            imageView= (ImageView) itemView.findViewById(R.id.iv_single_item);
            textView= (TextView) itemView.findViewById(R.id.tv_single_item);
            switch (i) {
                case  0:
                    textView.setText("韩系名媛");

                    break;
                case 1:
                    textView.setText("气场欧美");
                    break;
                case 2:
                    textView.setText("优雅复古");
                    break;
                case 3:
                    textView.setText("清新文艺");
                    break;
                 case 4:
                     textView.setText("英伦学院");
                     break;
                 case 5:
                     textView.setText("甜美日系");
                     break;
                 case 6:
                     textView.setText("OL通勤");
                     break;
                 case 7:
                     textView.setText("街头混搭");
                     break;
                 case 8:
                     textView.setText("性感诱惑");
                     break;
            }
            ll_single_item.addView(itemView);
        }
    }

    private void initView() {
        scrollView= (ScrollView) view.findViewById(R.id.sv_single_body);


        ll_single_item= (LinearLayout) view.findViewById(R.id.ll_single_item);
    }


}
